package io.jpress.addon.securityinformation.directive;

import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.JFinal;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.template.Env;
import com.jfinal.template.io.Writer;
import com.jfinal.template.stat.Scope;
import io.jboot.db.model.Columns;
import io.jboot.web.controller.JbootControllerContext;
import io.jboot.web.directive.annotation.JFinalDirective;
import io.jboot.web.directive.base.JbootDirectiveBase;
import io.jboot.web.directive.base.PaginateDirectiveBase;
import io.jpress.JPressOptions;
import io.jpress.addon.securityinformation.model.JpressAddonSecurityinformationMfdr;
import io.jpress.addon.securityinformation.service.JpressAddonSecurityinformationMfdrService;
import io.jpress.commons.directive.DirectveKit;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

/**
 * Mfdr 搜索
 * anjie 2020年3月27日
 * userid不能是空
 */
@JFinalDirective("MFDRdetails")
public class MFDRDirective extends JbootDirectiveBase {

    @Inject
    private JpressAddonSecurityinformationMfdrService service;

    @Override
    public void onRender(Env env, Scope scope, Writer writer) {
        Object id = getPara("id", scope);
        JpressAddonSecurityinformationMfdr byId = service.findById(id);
        scope.setLocal("MFDRdetails",byId);
        renderBody(env, scope, writer);
    }

    @Override
    public boolean hasEnd() {
        return true;
    }
}
